<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page pageEncoding="UTF-8" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<h1>System Config</h1>
<script type="text/javascript">
    function del(channelCode) {
        if (confirm("Are you delete [ " + channelCode + " ] ?")) {
            document.forms[0].action = "delete.dhtml?channelCode=" + channelCode;
            document.forms[0].submit();
        }
    }
</script>
<div class="main">
    <div class="box_side search_hotel clearfix">
        <form id="list_hotel_form" method="post">
            <h1>Channel Configuration</h1>

            <div align="right">
                <input class="common_button" type="button" value="Add"
                       onclick="window.location.href='./gotoAdd.dhtml'">
            </div>
            <table class="table_list" cellpadding="0" cellspacing="0">
                <thead>
                <tr>
                    <th>Channel Code</th>
                    <th>User Name</th>
                    <th>Password</th>
                    <th>IATA No.</th>
                    <th>Rate Plans</th>
                    <th>Operation</th>
                </tr>
                </thead>
                <s:iterator value="channelAuthorizations">
                    <tr>
                        <td>${derbyChannelCode}</td>
                        <td>${userName}</td>
                        <td>${password}</td>
                        <td>${iataNumber}</td>
                        <td>
                            <s:iterator value="ratePlans">
                                ${code}&nbsp;&nbsp;
                            </s:iterator>
                            &nbsp;&nbsp;
                        </td>
                        <td><a href="edit.dhtml?channelCode=${derbyChannelCode}">Edit</a>
                            &nbsp;&nbsp;
                            <a style="color: #ff0000;" onclick="del('${derbyChannelCode}');"
                               href="#">Delete</a></td>
                    </tr>
                </s:iterator>
            </table>
        </form>
    </div>
</div>